package com.hnevc.lizhimao;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    private Button turnOnBtn;
    private Button turnOnffBtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        initData();
        initEvent();
    }private  void initView(){
        turnOnBtn = findViewById(R.id.turnOn_btn);
        turnOnffBtn = findViewById(R.id.turnff_btn);

    }
    private  void  initData(){

    }private  void  initEvent(){
        turnOnBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intet=new Intent(MainActivity.this,MyService.class);
                startService(intet);
            }
        });
        turnOnffBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent =new Intent(MainActivity.this,MyService.class);
                startService(intent);
            }
        });
      }
}